﻿using System.Collections.Generic;
using System.Linq;
using System.Windows;

using Microsoft.Phone.Controls;

namespace CloudItemSample
{
    using System.Collections.ObjectModel;
    using System.Windows.Controls;

    using devMobile.Controls;

    public partial class MainPage : PhoneApplicationPage
    {

        private ObservableCollection<string> source = new ObservableCollection<string>()
            {
                "Hotel",
                "Bar",
                "Comida",
                "Cena",
                "Hotel",
                "Comida",
                "Barcelona",
                "Andorra",
                "Desayuno",
                "Dietas",
                "Peaje",
                "Peaje",
                "Otros",
                "Hotel",
                "Hotel",
                "Bar",
                "Comida",
                "Cena",
                "Hotel",
                "Comida",
                "Barcelona",
                "Andorra",
                "Desayuno",
                "Dietas",
                "Peaje",
                "Peaje",
                "Otros",
                "Hotel",
                "Bar",
                "Comida",
                "Cena",
                "Hotel",
                "Comida",
                "Barcelona",
                "Andorra",
                "Desayuno",
                "Dietas",
                "Peaje",
                "Peaje",
                "Otros",
                "Cafe",
                "Cafe",
                "Tabaco",
                "Pizza",
                "Pizza",
                "Fiesta",
                "Excursión",
                "Electronica",
                "Electrónica",
                "Electrónica",
                "Revistas",
                "Prensa",
                "Prensa"
            };

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.cloudContainer.ItemsSource = source;
        }

        private void cloudContainer_TagSelected(object sender, string tag)
        {
            MessageBox.Show(tag);
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            source.Add("Gibraltar");
        }
    }
}